package com.eastfair.mobile.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.eastfair.boot.request.PageParams;
import com.eastfair.core.base.R;
import com.eastfair.mobile.service.MobileArrangementManageService;
import com.eastfair.venueservice.dto.ArrangementManageDTO;
import com.eastfair.venueservice.dto.ArrangementManagePageQuery;
import com.eastfair.venueservice.vo.ArrangementManageVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 * 前端控制器
 * 布撤展管理
 * </p>
 *
 * @author lyw
 * @date 2022 -09-13
 */
@Slf4j
@Validated
@RestController
@RequestMapping("/mobileArrangement")
@Api(value = "mobileArrangement", tags = "布撤展管理")
public class MobileArrangementManageController {

    @Resource
    private MobileArrangementManageService mobileArrangementManageService;

    /**
     * 查询布撤展管理列表分页
     *
     * @param params the params
     * @return r
     */
    @ApiOperation(value = "查询布撤展管理列表分页")
    @PostMapping(value = "/queryArrangementManageList")
    public R<Page<ArrangementManageVO>> queryArrangementManageList(@RequestBody PageParams<ArrangementManageDTO> params) {
        Page<ArrangementManageVO> page = mobileArrangementManageService.queryArrangementManageList(params);
        return R.success(page);
    }

    /**
     * 查询布撤展管理详情
     *
     * @param arrangementManageDTO the arrangement manage dto
     * @return r
     */
    @ApiOperation(value = "查询布撤展管理详情")
    @PostMapping(value = "/queryArrangementManageInfo")
    public R<ArrangementManageVO> getArrangementManage(@RequestBody ArrangementManageDTO arrangementManageDTO) {
        ArrangementManageVO arrangementManageVO = mobileArrangementManageService.getArrangementManage(arrangementManageDTO);
        return R.success(arrangementManageVO);
    }

    /**
     * 保存布撤展管理
     *
     * @param arrangementManageDTO the arrangement manage dto
     * @return r
     */
    @ApiOperation(value = "保存布撤展管理")
    @PostMapping(value = "/saveArrangementManageInfo")
    public R<Boolean> saveArrangementManage(@RequestBody ArrangementManageDTO arrangementManageDTO) {
        return R.success(mobileArrangementManageService.saveArrangementManage(arrangementManageDTO));
    }

    /**
     * 修改布撤展管理
     *
     * @param arrangementManageDTO the arrangement manage dto
     * @return r
     */
    @ApiOperation(value = "修改布撤展管理")
    @PostMapping(value = "/updateArrangementManageInfo")
    public R<Boolean> updateArrangementManage(@RequestBody ArrangementManageDTO arrangementManageDTO) {
        return R.success(mobileArrangementManageService.updateArrangementManage(arrangementManageDTO));
    }

    /**
     * 删除布撤展
     *
     * @param id the id
     * @return r
     */
    @ApiOperation(value = "删除布撤展")
    @GetMapping(value = "/delArrangementManageInfo/{id}")
    public R<Boolean> delArrangementManage(@PathVariable Long id) {
        return R.success(mobileArrangementManageService.delArrangementManage(id));
    }

}
